package com.sskj.gateway.event;

import com.sskj.common.dto.DeviceTelemetry;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.context.ApplicationEvent;

public class DeviceMessageEvent extends ApplicationEvent {

    private ChannelHandlerContext channelHandlerContext;

    public DeviceMessageEvent(DeviceTelemetry source, ChannelHandlerContext channelHandlerContext) {
        super(source);
        this.channelHandlerContext = channelHandlerContext;
    }

    public DeviceTelemetry getMessage() {
        return (DeviceTelemetry) getSource();
    }

    public ChannelHandlerContext getChannelHandlerContext() {
        return channelHandlerContext;
    }
}
